/**
 * Created By zhangQ 2018/2/14
 */
import types from './mutations-types'

let mutations = {
  [types.setCurrentUser] (state, userInfo) {
    sessionStorage.setItem('currentUser', JSON.stringify(userInfo))
    state.currentUser = userInfo
  },
  [types.setActiveMenu] (state, routerName) {
    state.activeMenu = routerName
  },
  [types.setCurrentToken] (state, token) {
    if (token) {
      sessionStorage.setItem('currentToken', token)
    }
    state.currentToken = token
  }
}

export default mutations
